<template>
  <div>
    <el-row>
      <el-button type="primary" @click="toback" plain>返回</el-button>
      <el-button type="primary" @click="addprojects" plain>保存且新增</el-button>
      <el-button type="primary" plain>导入</el-button>
      <br /><br />
    </el-row>
    <!-- #07c4a8 -->
    <hr style="background-color: #07c4a8; height: 1px; border: none" />
    <br />
    <center>
      <h2>项目状态变更</h2>
    </center>

    <div style="width: 90%; margin: 0 auto">
      <div style="width: 100%">
        <span style="font-weight: 700; font-size: 20px">|基本信息</span>
      </div>
      <el-divider></el-divider>
      <el-form label-width="100px" style="width: 100%">
        <el-container>
          <el-form-item label="项目名称:">
            <input type="hidden" v-model="projectstatusadd.id" />
            <el-input v-model="projectstatusadd.projectName">
              <el-button
                slot="append"
                icon="el-icon-search"
                @click="dj"
              ></el-button>
            </el-input>
          </el-form-item>
          <el-form-item label="项目状态">
            <el-select
              v-model="projectstatusadd.projectStatus"
              placeholder="项目状态"
            >
              <el-option label="请选择" value=""></el-option>
              <el-option label="信息立项" value="信息立项"></el-option>
              <el-option label="资格审查" value="资格审查"></el-option>
              <el-option label="放弃" value="放弃"></el-option>
              <el-option label="竣工" value="竣工"></el-option>
              <el-option label="中标" value="中标"></el-option>
              <el-option label="投标" value="投标"></el-option>
              <el-option label="落标" value="落标"></el-option>
              <el-option label="立项分析" value="立项分析"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="填报人:">
            <el-input v-model="projectstatusadd.name">
              <el-button
                slot="append"
                icon="el-icon-search"
                @click="dj"
              ></el-button>
            </el-input>
          </el-form-item>
        </el-container>
        <el-container>
          <!-- <el-form-item label="当前时间:">
            <el-input
              type="datetime"
              v-model="projectstatusadd.presentTime"
              readonly
            ></el-input>
          </el-form-item> -->

          &nbsp;
          <div class="block">
            <span class="demonstration">当前时间:</span>&nbsp;
            <el-date-picker
              v-model="projectstatusadd.presentTime"
              type="datetime"
              placeholder="选择日期时间"
            >
            </el-date-picker>

          </div>
        </el-container>
      </el-form>
    </div>
    <el-dialog title="提示" :visible.sync="dialogVisible" width="70%">
      <project-info-list
        v-if="dialogVisible"
        @row="project"
      ></project-info-list>
    </el-dialog>
  </div>
</template>

<script>
import ProjectInfoList from "../common/projectInfo/ProjectInfoList.vue";

export default {
  components: { ProjectInfoList },
  data() {
    return {
      projectstatusadd: {},
      dialogVisible: false,
    };
  },

  methods: {
    //响应项目组件
    project(row) {
      this.projectstatusadd.projectName = row.projectName;
      this.projectstatusadd.id = row.id; //获取所属项目id
      this.dialogVisible = false;
    },

    dj() {
      this.dialogVisible = true;
    },
    //返回查询页面
    toback() {
      this.$emit("toback");
    },

    //获取当前时间
    nowdate(){
      var dtime=new Date();

      this.projectstatusadd.presentTime=dtime.getTime();
    },
    //添加
    addprojects(){
      this.$emit("addprojects", this.projectstatusadd);
    }
    
  },
  created(){
    this.nowdate();
  }
  
};
</script>

<style>
</style>